const client = require('./client');

async function deleteInstance(InstanceId) {
  const params = {
    InstanceId,
    Force: true,
  };

  const requestOption = {
    method: 'POST',
  };

  return await client.request('DeleteInstance', params, requestOption);
}

async function deleteInstances(instanceIds) {
  const promises = [];
  for (const id of instanceIds) {
    promises.push(deleteInstance(id));
  }
  return await Promise.all(promises);
}

// let instanceIds = ['i-t4nf7371evyia69gg6zv','i-t4n191gh7vw57w9gp3m4','i-t4nccx2z2k7205k3kwrc'];
// deleteInstances(instanceIds);

module.exports = deleteInstances;
